use actix_web::{App, HttpServer};
use std::io;

#[path = "handler.rs"]
mod handlers;
#[path = "model.rs"]
mod models;
#[path = "router.rs"]
mod routers;

use routers::*;

#[actix_rt::main]
async fn main() -> io::Result<()> {
    // 创建Web应用
    let app = move || {
        App::new()
            // 设置路由
            .configure(general_routes)
    };

    HttpServer::new(app).bind("127.0.0.1:3000")?.run().await
}